# fix_all.py
import pathlib, os

root = pathlib.Path(__file__).parent
docs = root / "docs"

rename_map = {
    "fig_growth.png": "fig_4_1_growth.png",
    "fig_storage_compare.png": "fig_5_2_storage.png",
    "fig_benchmark.png": "fig_5_3_benchmark.png"
}

for old, new in rename_map.items():
    old_path = docs / old
    new_path = docs / new
    if old_path.exists() and not new_path.exists():
        old_path.rename(new_path)
        print(f"✅ 重命名 {old} → {new}")
    elif new_path.exists():
        print(f"⚠️ {new} 已存在，跳过")
    else:
        print(f"⚠️ 未找到 {old}")

print("✅ 图表检查完成！")